import java.util.Arrays;

public class NumsTarget {
    public static int[] find(int[] arr,int n) {
        int[] arr1 = new int[2];
        for(int i = 0; i < arr.length;i++ ) {
            int j = 0;
            for(j = i + 1;j < arr.length; j++) {
                if(arr[i] + arr[j] == n) {
                    arr1[0] = i;
                    arr1[1] = j;
                    return arr1;
                }
            }
        }
        return null;
    }
    public static void main(String[] args) {
        int[] arr = {1,3,5,6,8,9};
        int n = 7;
        System.out.println(Arrays.toString(find(arr, n)));
    }
}
